package top.kangyaocoding.tech.model;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 描述:
 *
 * @author K·Herbert
 * @since 2025-04-16 15:04
 */
@Getter
@AllArgsConstructor
public enum MessageTypeEnum {
    USER("user"),
    ASSISTANT("assistant"),
    SYSTEM("system");

    private final String value;

    // 通过字符串值获取枚举类型
    public static MessageTypeEnum fromValue(String value) {
        for (MessageTypeEnum type : MessageTypeEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown message type: " + value);
    }
}
